/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.acionista.base.util;

import java.io.Serializable;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 *
 * @author joao
 */
public class ListenerContexto implements ServletContextListener, Serializable {
	
    @Override
    public void contextInitialized(ServletContextEvent ev) {
        try {
           JPAUtil.carregarFabrica();
           System.out.println("Fabrica JPA carregada com sucesso.");
        } catch (Exception e) {
            System.out.println("Erro na carregamento da fabrica do JPA - " + e.getMessage());
        }
    }
    
    @Override
    public void contextDestroyed(ServletContextEvent ev) {
        System.out.println("Fabrica JPA carregada com sucesso.");
    }    
}